package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.AbnormalEventsMapper;
import com.ruoyi.user.domain.AbnormalEvents;
import com.ruoyi.user.service.IAbnormalEventsService;

/**
 * 异常情况Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-21
 */
@Service
public class AbnormalEventsServiceImpl implements IAbnormalEventsService 
{
    @Autowired
    private AbnormalEventsMapper abnormalEventsMapper;

    /**
     * 查询异常情况
     * 
     * @param id 异常情况主键
     * @return 异常情况
     */
    @Override
    public AbnormalEvents selectAbnormalEventsById(Long id)
    {
        return abnormalEventsMapper.selectAbnormalEventsById(id);
    }

    /**
     * 查询异常情况列表
     * 
     * @param abnormalEvents 异常情况
     * @return 异常情况
     */
    @Override
    public List<AbnormalEvents> selectAbnormalEventsList(AbnormalEvents abnormalEvents)
    {
        return abnormalEventsMapper.selectAbnormalEventsList(abnormalEvents);
    }

    /**
     * 新增异常情况
     * 
     * @param abnormalEvents 异常情况
     * @return 结果
     */
    @Override
    public int insertAbnormalEvents(AbnormalEvents abnormalEvents)
    {
        abnormalEvents.setCreateTime(DateUtils.getNowDate());
        return abnormalEventsMapper.insertAbnormalEvents(abnormalEvents);
    }

    /**
     * 修改异常情况
     * 
     * @param abnormalEvents 异常情况
     * @return 结果
     */
    @Override
    public int updateAbnormalEvents(AbnormalEvents abnormalEvents)
    {
        return abnormalEventsMapper.updateAbnormalEvents(abnormalEvents);
    }

    /**
     * 批量删除异常情况
     * 
     * @param ids 需要删除的异常情况主键
     * @return 结果
     */
    @Override
    public int deleteAbnormalEventsByIds(Long[] ids)
    {
        return abnormalEventsMapper.deleteAbnormalEventsByIds(ids);
    }

    /**
     * 删除异常情况信息
     * 
     * @param id 异常情况主键
     * @return 结果
     */
    @Override
    public int deleteAbnormalEventsById(Long id)
    {
        return abnormalEventsMapper.deleteAbnormalEventsById(id);
    }
}
